package hlhj.fhp.checkpoint.adp

import android.view.View
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import hlhj.fhp.checkpoint.R
import hlhj.fhp.checkpoint.javaBean.MoneyBean

/**
 * Created by Never Fear   on 2018\11\12 0012.
Never More....
 */
class MoneyAdp(private val datas:ArrayList<MoneyBean.InfoBean.DataBean>)
    :BaseQuickAdapter<MoneyBean.InfoBean.DataBean,BaseViewHolder>(R.layout.money_item,datas) {
    override fun convert(helper: BaseViewHolder?, item: MoneyBean.InfoBean.DataBean?) {
        helper?.setText(R.id.tv1,item?.remark)
        helper?.setText(R.id.itemTime,item?.create_time)
        helper?.setText(R.id.move,item?.price)
        val loReason = helper?.getView<View>(R.id.loReason)
        when(item?.status){
            1->{
                helper?.setText(R.id.itemStatus,"已处理")
                loReason?.visibility=View.GONE
            }
            0->{
                helper?.setText(R.id.itemStatus,"处理中")
                loReason?.visibility=View.GONE
            }
            2->{
                helper?.setText(R.id.itemStatus,"已驳回")
                loReason?.visibility=View.VISIBLE
                helper?.setText(R.id.itemReason,item?.refuse_reason)
            }
        }
    }
}